xend: Fix startup when dom0 does not see all physical cpus.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Mar 2007 15:08:26 +0000 (15:08 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Mar 2007 15:08:26 +0000 (15:08 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/XendNode.py

index f550a467a9eb7d646cda39cba58dada09d85e062..07c814be7bf1f57725a4d7eb708e9456e2a9075d 100644 (file)
@@ -97,6 +97,10 @@ class XendNode:
         for u in self.cpus.keys():
             log.error(self.cpus[u])
             number = self.cpus[u]['number']
+            # We can run off the end of the cpuinfo list if domain0 does not
+            # have #vcpus == #pcpus. In that case we just replicate pcpu0 info.
+            if not cpuinfo.has_key(number):
+                number = 0
             log.error(number)
             log.error(cpuinfo)
             self.cpus[u].update(